package top.ivansong92.example.leetcode.learning.other;


import org.junit.Test;

import java.lang.annotation.Annotation;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.List;

public class ReflectionExample {

	@Test
	public void test1() {
		List<Field> excelFields = new ArrayList<>();
		for(Field field : Person.class.getDeclaredFields()) {
			Annotation annotation = field.getAnnotation(ExcelColumn.class);
			if (annotation != null) {
				field.setAccessible(true);
				excelFields.add(field);
			}
		}
		Person pers= new Person();
		pers.setName("kkk");
		pers.setTitle("ttt");

		for(Field field : excelFields) {
			try {

				System.out.println(field.get(pers));
			}  catch (IllegalAccessException e) {
				e.printStackTrace();
			}
		}


		int k =1230;
		k ^= 123;
		k ^= 1230;
		System.out.println(k);
	}



}
